# Contributor: Damian Kurek <starfire24680@gmail.com>
# Maintainer: Damian Kurek <starfire24680@gmail.com>
pkgname=kodi-game-libretro-beetle-psx
pkgver=0.9.44.53
_realname=Nexus
pkgrel=0
pkgdesc="Beetle-PSX for Kodi"
options="!check" # no test suite
url="https://github.com/kodi-game/game.libretro.beetle-psx"
arch="x86_64 aarch64 armv7" # kodi is available only on these architectures
license="GPL-2.0-or-later"
depends="kodi-game-libretro libretro-beetle-psx"
makedepends="cmake kodi-dev samurai"
source="$pkgname-$pkgver-$_realname.tar.gz::https://github.com/kodi-game/game.libretro.beetle-psx/archive/$pkgver-$_realname.tar.gz"
builddir="$srcdir/game.libretro.beetle-psx-$pkgver-$_realname"

build() {
	cmake -B build -G Ninja \
		-DCMAKE_BUILD_TYPE=None \
		-DCMAKE_INSTALL_PREFIX=/usr \
		-DCMAKE_MODULE_PATH=/usr/lib/cmake/kodi
	cmake --build build
}

package() {
	DESTDIR="$pkgdir" cmake --install build
	rm -f "$pkgdir"/usr/lib/kodi/addons/game.libretro.beetle-psx/game.libretro.beetle-psx.so
	ln -s /usr/lib/libretro/mednafen_psx_libretro.so \
		"$pkgdir"/usr/lib/kodi/addons/game.libretro.beetle-psx/game.libretro.beetle-psx.so
}

sha512sums="
853ab086d35ca5f2a2cab924ef55d443bec63451a5b38951fe89b91822f80dcaf5b541dad293b6bd370785812e62c49ad8b2a9f5e819b2b4393eee4020e9c965  kodi-game-libretro-beetle-psx-0.9.44.53-Nexus.tar.gz
"
